package com.alipay.config;

/**
 * @program: alipay_test
 * @description:
 * @author: 李晓龙
 * @create: 2021-12-21 11:03
 **/

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118675561";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCMQ89jgSdDDYIZnyGFkbnY0e/VM9r2Qhg2sWoeJIWDvtlNgjgD97caeIaSH3MHR93wC/DB/QhmojXYwX9TX2XcC7j3wZzrPxz7Hi7IkD66nVQh5AP/0J9IB/yWMHMI2GZedy89x2UcWkOwzU6B0rpvJJLaEBhoS77PGnS7ZQ8wnM4M/S8XQ+/nfnWHZ9xwIV2sdWwbcczfKUk1Vrx9XubMPrzDBgWA1Zb6M6lJxUUONIMkNeoQyCPypyxBTTAqgO4q5q9ulmdRKlgs741SrRIENh/KQ+Ov6zUiT5ulZNwKCwT1Ew2sa/oiuq3GBVTd98gc7CpOtDVEs+mLl8AiEma5AgMBAAECggEAIIBuA+6ffGga53j6OYsk91reKhcT+9Ag8Dt4DXgFABwvGki8Vh8GbLnU5PMool1CzibWKP1K/w1DUPC1YkpOvghxWeehRtmfC4lY6dySzIc8QYYmbxaWcgh3vQ2I+lm6jtUrOzOC+GjqGoPYVzjPPoXJCYKFRVWX50GIHwwx0t+JcYBxDs4UNFn6GvMSbnfut46IUJdixkBh76dGEfA2HglqVr9rj7gHp1BE+ZNbux+8yRrC/6Z798du1yizE6eBdvu+YhzuSoy9OGRsEJgT8Ss6b5PLhLSGjIQTVEljdQmkuhp4ITFUJ1RxRSbOz9IgGgW2L4tpjnoRztb0zfkNCQKBgQDlAEl3//fMaaj1PBVouoMUlWDq8EpzPAegbOITO6OBljmHfOoUMACx0lhsjCcBeRCFF00ZVfWlMqOLphJdY1vYORVUrqLJMy8/8NhbOpIsV+sWbUs5ReDXaSRHAkAS2D44byEObG6FZZBozYmFj7iwyhObzpRQC0fiR3eBLwEoGwKBgQCczUkZHS2tPq6nSYPsNy4PpeB77HtpubwjtVGaGSJTvgkc3Hu49VXVOC0GkBjUprcX9pj50l09Z8qautzJmfTjQycAfxhTphsPhGHVZM4NEK1spBtOdtn/TZLFiyj4jqrAHspGzKjGN7XF55dJ0Pp7WrRpDix8ga4bAgf6FlYBuwKBgQCbDYSxQZkwyOHjmhkM3ixexX3n1WczexPW5aJ1T044MdUmDcgYfyAZRskkRgkrECPFWa+UVgWLIyxlI78PiHTphE0TF2OVQ5jcfGCh9JiAec7tUnc6gjvo3oH3qmhj2hLW9ze0omp62/fZXkGdM2DkIw7/0fHN+LVlWupph8AKvQKBgCZhsaTuGYIwt7vHKP2nPCUka2CqMENe7YioF4Nq55YsDDr+VWKe2xXIHG1g1FMpQ+Qfvq5YKe6f+14Io4bNor4GcAOVGLVREYqo0vHTLQTRskHHoc+BFDeEG4szVyIQegdxAf52llF+zYXV/JhbCRUszMBycb1AWQfPZXh4AzGFAoGAekiDOcceC18Kd6GbyJe+sK11zO82o8KYaomzib7Q6FmComEvp21two6Rau8YFC9p38lshAfHWrmPm+0lyk6WOti5H/vCJDM/YwSXj8TUAY2n875tTpDGcQUsiN+m4sY4mTRoIXe/09rvAfKIFqqiL7qCgl7XR1FdBvFBf6uyo08=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxj6L0Ql3vu7pe07UlMPxpKrfOfNl3J//DnLV7YUrj62N0oKNMF1gyU7BDJPS1FpKmd/pYkKzYmnLgQ4WgS/ZU5iVxIZZ7iJyKRq+th3YlIUGu9dCmZHpXymVNT/myB5l2ZqBqHA4oVUyHGXRmFSaQYdLktSoHgyeWVC2WE3uH5BaiRSrbLY3wUTVoQy69kdOihujFSFZIOzXzK/oSc8QrFJ6zMMRTLJEEFxuEIm49aicG0ej8n9vZtYKP3pgULWFcz9/yMs/lmXPYb3pf1sWTuG7dvn3nBUtazdyg1uWfZzMCV+H2sGLrkNlZ/HkQ+DlkVBCwUFa3ZYjfEVdIX3+fQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:/9527/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:/9527/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}


